<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>表格表单的补充</title>
        <style>
            table {
                caption-side: top;
                border: 2px solid #000000;
                width: 500px;
                height: 400px;
                margin: auto;
                border-collapse: collapse;
                border-spacing: 0;
                text-align: center;
                vertical-align: center;
                table-layout: fixed; /*auto:列的宽度随着内容变化*/
            }

            th, td {
                border: 1px solid #bbbbbe;
            }
        </style>
    </head>
    <body>
        <table>
            <colgroup>
                <col span="1" style="background-color:red;">
                <col span="2" style="background-color:yellow;">
                <col span="1" style="background-color:green;">
            </colgroup>
            <caption>标题</caption>
            <thead>
            <tr>
                <th>列1</th>
                <th>列2</th>
                <th>列3</th>
                <th>列4</th>
            </tr>
            </thead>

            <tfoot>
            <tr>
                <td colspan="2">总计：</td>
                <td colspan="2"></td>
            </tr>
            </tfoot>
            <tbody>
            <tr>
                <td>值1</td><!--lorem：随机文本 -->
                <td>值2</td>
                <td>值3</td>
                <td>值4</td>
            </tr>
            <tr>
                <td>值1.1</td>
                <td>值2.2</td>
                <td>值3.3</td>
                <td>值4.4</td>
            </tr>
            </tbody>
        </table>
    </body>
</html>